import {createRouter, createWebHashHistory} from "vue-router";

// 通用UI
const home_login = () => import('../views/home/login.vue');
// 客户端的UI
const log = () => import('../views/client/log.vue');
const config = () => import('../views/client/config.vue');
const manage = () => import('../views/client/manage.vue');

const routes = [
    {path: '/', component: home_login},
    //前端UI
    {
        path: '/client', component: manage,
        children: [
            {path: '', redirect: '/client/log'},
            {path: 'log', component: log, name: "log"},
            {path: 'config', component: config, name: "config"},
        ],
    },
]

// 3. 创建路由实例并传递 `routes` 配置
// 你可以在这里输入更多的配置，但我们在这里
// 暂时保持简单
export const router = createRouter({
    // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
    history: createWebHashHistory(),
    routes, // `routes: routes` 的缩写
})
